/**
 * 
 */
package STUDENTS.NGUYENQUANGTAM.MVC.BT2;

/**
 * @author Mr. Tam
 *
 */
public class MODELS {
	public double CalElement(CALCULATORS obj) {
		double dResult = 0;
		switch (obj.getbOpt()) {
		case 0:
			dResult = obj.getdNumA() + obj.getdNumB();
			break;
		case 1:
			dResult = obj.getdNumA() - obj.getdNumB();
			break;
		case 2:
			dResult = obj.getdNumA() * obj.getdNumB();
			break;
		case 3:
			dResult = obj.getdNumA() / obj.getdNumB();
			break;
		default:
			break;
		}
		return dResult;

	}
}
